package co.yixiang.modules.system.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
* @author zf
* @date 2020-08-15
*/
@Data
@Accessors(chain = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("g_page_view_day")
public class PageViewDay implements Serializable {

    @TableId
    private Integer id;


    /** 商户id */
    private String shopId;


    /** 统计日期 */
    private LocalDateTime day;


    /** 浏览量 */
    private Integer views;


    /** 创建日期 */
    @TableField(fill= FieldFill.INSERT)
    private LocalDateTime createDate;


    public void copy(PageViewDay source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
